<template>

  <div v-if="pageData?.solvePlanBase">
    <bannerList :pageData="pageData"></bannerList>

    <div class="pageContainer">
      <div class="boxTitle boxMargin">
        <div class="title ">
          <h1 style="">{{pageData.solvePlanBase?.planOverviewBackTitle}}</h1>
          <h2>{{pageData.solvePlanBase?.planOverviewTitle}}</h2>
        </div>
      </div>

      <div class="overview">
        <div class="title">{{pageData.solvePlanBase?.ultrasonicPlanTitle}}</div>
        <div class="text">{{pageData.solvePlanBase?.ultrasonicPlanDesc}}</div>

        <div class="img">
          <img :src="pageData.solvePlanBase.planOverviewImg"/>
        </div>

      </div>

      <div class="boxTitle">
        <div class="title ">
          <h1 style="">{{pageData.solvePlanBase?.planBackgrodBackTitle}}</h1>
          <h2>{{pageData.solvePlanBase?.planBackgrodTitle}}</h2>
        </div>
      </div>


      <div class="overview">
        <div class="text" style="padding-top: 0;">{{pageData.solvePlanBase?.planBackgrodTitleDesc}}</div>
        <div class="title" style="padding-top: 1vw;">{{pageData.solvePlanBase?.demandDriven}}</div>
      </div>

      <div class="backText" style="">
        <div class="item" v-for="item in pageData.backdropLists">
          <div class="title" v-html="item.title"></div>
          <div class="img">
            <img :src="item.imgUrl"/>
          </div>
        </div>
      </div>


      <!--&lt;!&ndash;市场应用&ndash;&gt;-->
      <useMarket :pageData="pageData"></useMarket>

      <!--&lt;!&ndash;方案优势&ndash;&gt;-->
      <advantages :pageData="pageData"></advantages>

      <!--&lt;!&ndash;方案价值&ndash;&gt;-->
      <programValue :pageData="pageData"></programValue>
    </div>
  </div>
  <div v-else class="headerPlace">

  </div>
</template>

<script setup>
  import {ref, onMounted} from 'vue'
  import {apigetSolvePlan} from '@/api/index.js'
  import useMarket from './useMarket.vue' // 发展历程
  import advantages from './advantages.vue' // 方案优势
  import programValue from './programValue.vue' // 方案价值
  import bannerList from './bannerList.vue' // 方案价值

  const pageData = ref({
    solvePlanBase: {}
  })
  onMounted(() => {
    apigetSolvePlan({}).then((res) => {
      pageData.value = res
      if (!res.solvePlanBase) {
        // pageData.value.solvePlanBase = {}
      }
    })
  })

</script>

<style scoped lang="scss">
  @media screen and (max-width: 1079px) {
    .boxMargin {
      margin-top: 10px;
    }

    .overview {
      .title {
        font-size: 16px;
        font-weight: bold;
      }
      .text {
        font-size: 14px;
        padding-top: 1vw;
        line-height: 20px;
        margin-bottom: 10px;
      }
      .img {
        margin: 0 auto;
        img {
          width: 100%;
          height: auto;
          display: block;
          padding: 5px 0 10px;
        }
      }
    }

    .backText {

      .item {
        border: 1px solid #e8e8e8;
        margin-top: 10px;
        padding: 10px; flex: 1;
        .title {
          background-color: #1027ef;
          margin-bottom: 10px;
          color: #fff;
          text-align: center;
          font-size: 14px;
          padding: 6px 0;
          font-weight: bold;
        }
        .img {
          width: 60%;
          margin: 0 auto;
          img {
            width: 100%;
            height: auto;
            display: block;
          }
        }
      }
    }
  }

  @media screen and (min-width: 1080px) {
    .headerPlace{
      height: 4.5vw; background-color: #1027EF;
    }
    .boxMargin {
      margin-top: 4vw;
    }

    .overview {
      .title {
        font-size: 1.2vw;
        font-weight: bold;
      }
      .text {
        font-size: 0.9vw;
        padding-top: 1vw;
        line-height: 1.8vw;
      }
      .img {
        width: 60vw;
        margin: 0 auto;
        img {
          width: 100%;
          height: auto;
          display: block;
          padding: 1vw 0 2vw;
        }
      }
    }

    .backText {
      display: flex; width: 100%;
      gap: 1vw;
      padding-top: 1.6vw;
      .item {
        border: 1px solid #e8e8e8; flex: 1;
        padding: 1vw;
        .title {
          background-color: #1027ef;
          margin-bottom: 1vw;
          color: #fff;
          text-align: center;
          font-size: 1vw;
          padding: 0.5vw;
          font-weight: bold;
        }
        .img {
          width: 100%;
          img {
            width: 100%;
            height: auto;
            display: block;
          }
        }
      }
    }
  }


</style>
